<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Honeydew管理介面</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Jquery -->
<script src="http://code.jquery.com/jquery.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<!-- carousel -->
<link href="${pageContext.request.contextPath}/css/carousel.css" rel="stylesheet" />
<!-- Bootstrap -->
<link href="${pageContext.request.contextPath}/bootstrap-3.1.1-dist/css/bootstrap.min.css" rel="stylesheet" media="screen" />
<script src="${pageContext.request.contextPath}/bootstrap-3.1.1-dist/js/bootstrap.min.js"></script>
<!-- responsive -->
<link href="${pageContext.request.contextPath}/css/bootstrap-responsive.css" rel="stylesheet" type="text/css">
<!-- holder -->
<script src="${pageContext.request.contextPath}/holder/holder.js"></script>
<!-- commons -->
<link href="${pageContext.request.contextPath}/css/commons.css" rel="stylesheet" />

<!-- Manage -->
<script src="${pageContext.request.contextPath}/js/manage.js"></script>
<script>
$(function() {
});
</script>

</head>

<body>
<s:set var="theme" value="'simple'" scope="page" />
<s:form id="query_form" action="queryOrderInformation">
	<h1>訂單資訊管理</h1>
	<table width="100%" height="100%">
		<tr>
			<td>
				<s:include value="manage_head.jsp" />
			</td>
		</tr>
		<tr>
			<td>
			
				<!-- 查詢條件 -->
				<table width="100%" class="table table-bordered">
					<tr>
						<th>會員帳號</th>
						<td colspan="1">
							<s:textfield theme="simple" id="userMemberQb.Email" name="userMemberQb.Email" />
						</td>
						<th>訂單編號</th>
						<td colspan="1">
							<s:textfield theme="simple" id="orderInformationQb.Number" name="orderInformationQb.Number" />
						</td>
					</tr>
					<tr>
						<th>訂單狀態</th>
						<td colspan="3">
							<s:select id="orderInformationQb.State" name="orderInformationQb.State" list="#{1:'訂單成立', 2:'訂單已付款', 3:'訂單已出貨', 4:'訂單失效'}"></s:select>
						</td>
					</tr>
				</table>
				
				<div align="right">
					<span>
						<a href="
						<s:url action='executeCreateOrderInformation'>
						</s:url>">新增</a>
					</span>
					<s:submit id="queryBtn" cssClass="btn" value="查詢" />
				</div>
				
				<s:if test="%{orderInformationList != null}">
					<table width="100%" class="table table-hover">
						<tr>
							<th>#</th>
							<th>會員帳號</th>
							<th>訂單編號</th>
							<th>訂單總金額</th>
							<th>商品總數量</th>
							<th>付款方式</th>
							<th>運送方式</th>
							<th>最後處理日期</th>
							<th>出貨日期</th>
							<th>商品狀態</th>
							<th>功能</th>
						</tr>
						
						<s:iterator value="orderInformationList" status="st">
							<tr>
								<td>
									<s:property value="#st.index + 1" />
									<s:hidden value="%{Seqid}" />
								</td>
								<td>
									<s:property value="Account" />
								</td>
								<td>
									<s:property value="Number" />
								</td>
								<td>
									<s:property value="Totalmoney" />
								</td>
								<td>
									<s:property value="Totalitems" />
								</td>
								<td>
									<s:property value="Paymentmethodseqid.Paymentname" />
								</td>
								<td>
									<s:property value="Transportmethodseqid.Transportname" />
								</td>
								<td>
									<s:property value="Processfinaldate" />
								</td>
								<td>
									<s:property value="Outorderdate" />
								</td>
								<td>
									<s:property value="@lance.honeydew.util.OrderInformationUtil@getStateStr(State)" />
								</td>
								<td>
									<a href="
									<s:url action='executeUpdateOrderInformation'>
										<s:param name='orderInforSeqId' value='Seqid' />
									</s:url>">修改</a>
									
									<input id="delete" class="btn" type="button" onclick="ajaxDeleteOrderInformation(<s:property value='Seqid' />);" value="刪除" />
								</td>
							</tr>
						</s:iterator>
					</table>
				</s:if>
				
			</td>
		</tr>
	</table>
</s:form>
</body>
</html>